<?php 

function signup($email, $username, $mobileid)
{
    DB::query("INSERT INTO users (mobile_id, email, username)
               VALUES (%s, %s, %s)", $mobileid, $email, $username);
}

function findUser($email)
{
    $row = return DB::queryFirstRow('SELECT * from users where email=%s', $email);
    return array('email' => $row['email'],
                 'id' => $row['id']);
}

?>